package model

import (
	"github.com/flipped-aurora/gin-vue-admin/server/global"
	"gorm.io/datatypes"
)

// IntelligentFormField 表单字段结构体
type IntelligentFormField struct {
	global.GVA_MODEL
	FormID      uint           `json:"formId" form:"formId" gorm:"column:form_id;comment:表单ID;not null;"`
	FieldType   string         `json:"fieldType" form:"fieldType" gorm:"column:field_type;comment:字段类型;size:50;not null;"`
	FieldKey    string         `json:"fieldKey" form:"fieldKey" gorm:"column:field_key;comment:字段标识;size:100;not null;"`
	FieldLabel  string         `json:"fieldLabel" form:"fieldLabel" gorm:"column:field_label;comment:字段标签;size:255;not null;"`
	FieldConfig datatypes.JSON `json:"fieldConfig" form:"fieldConfig" gorm:"column:field_config;comment:字段配置;not null;" swaggertype:"object"`
	IsRequired  bool           `json:"isRequired" form:"isRequired" gorm:"column:is_required;comment:是否必填;default:0;"`
	SortOrder   int            `json:"sortOrder" form:"sortOrder" gorm:"column:sort_order;comment:排序序号;default:0;"`
}

// TableName 表单字段 IntelligentFormField自定义表名 gva_intelligent_form_fields
func (IntelligentFormField) TableName() string {
	return "gva_intelligent_form_fields"
}
